-- Add DocType: "Test type 90" into root DocType Folder by DocCircAdmin
insert into DocType (DocTypeId, Folder, Name, Description, Prefix, NextNumber, IsNew, DcUser) values 
(default, @rootDocTypeFolder, 'Test type 90', '90', 'TTS', 1, false, @docCircAdmin); 
set @docType90:=last_insert_id(); 
--
	insert into RoutePoint (DocType, OrderNum, Expression) Values (@docType90, 1, '[0]');
	set @lastRoutePoint:=last_insert_id();
	insert into RouteItem (RoutePoint, DocType, DcUser, RouteItemType, ItemIndex) Values 
		(@lastRoutePoint, @docType90, @docCircUser1, @decisionRIT, 0);
--
insert into DocTypePermission (DocType, DcRole, C, R, U, D, RO, UO, DO) 
	select @docType90, DcRole, C, R, U, D, RO, UO, DO from NewDocTypePermission;

-- Add new DocType folder 90

insert into Folder (FolderType, ParentFolder, Name) Values 
	(@docTypeFolderType, @rootDocTypeFolder, 'saTestFolder1');
set @docTypeFolder90:=last_insert_id();

insert into FolderPermission (Folder, DcRole, C, R, U, D, B, RO, UO, DO)
	select @docTypeFolder90, DcRole, C, R, U, D, B, RO, UO, DO from NewFolderPermission
	where FolderType=@docTypeFolderType;
	
